import request from '@/utils/request'

/**
 * 车辆列表
 */
export function getList(month = '') {
	return request({
		url: `/app/car/list?month=${month}`,
		method: 'get',
	})
}

/**
 * 车辆详情
 */
export function getInfo(id) {
	return request({
		url: `/app/car/${id}`,
		method: 'get'
	})
}

/**
 * 添加车辆
 */
export function add(data) {
	return request({
		url: `/app/car`,
		method: 'post',
		data: data
	})
}

/**
 * 编辑车辆
 */
export function edit(data) {
	return request({
		url: `/app/car`,
		method: 'put',
		data: data
	})
}

/**
 * 删除车辆
 */
export function del(id) {
	return request({
		url: `/app/car/${id}`,
		method: 'post',
		data: {
			method: 'delete'
		}
	})
}